home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7345 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.1 KB  |  44 lines

  1. Path: news.azstarnet.com!usenet
  2. From: "S. Brenner" <brenner@azstarnet.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Help with Code
  5. Date: Thu, 22 Feb 1996 13:49:31 +0000
  6. Organization: Arizona Daily Star - AZSTARNET
  7. Message-ID: <312C746B.50DA@azstarnet.com>
  8. References: <4gi3l1$kou@news.voicenet.com>
  9. NNTP-Posting-Host: usr3ip22.azstarnet.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0 (Macintosh; I; PPC)
  14.  
  15. This code is from "Tech yourself C++ programming in 21 
  16. Days"
  17.  But I cannot get it to compile.  I am using Code warrrior gold 
  18. and ansi C++.
  19.  
  20. This is the error message I keep getting:
  21.  
  22. Error   : ambiguous access to overloaded function 
  23. 3.7.c line 9   cin >> DayOff;
  24.  
  25.  
  26. And this is the Code:
  27.  
  28. #include <iostream>
  29. void main()
  30. {
  31.     enum Days { Sunday, Monday, Tuesday, Wednesday, 
  32. Thursday, Friday, Saturday };
  33.     
  34.     Days DayOff;
  35.     
  36.     cout << "What day would you like off (0-6)? ";
  37.     cin >> DayOff;
  38.     
  39.     if (DayOff == Sunday || DayOff == Saturday)
  40.         cout << "\nYou're already off on weekends!\n";
  41.     else
  42.         cout << "\nOkay, I'll put in the vacation day.\n";
  43. }
  44.